/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 HandshakeResponse.hpp. Created on: 09.09.2009 12:16:33
 */

#ifndef HANDSHAKERESPONSE_HPP_
#define HANDSHAKERESPONSE_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"
#include "StdNetworkCommand.hpp"

namespace smartobjects {

class HandshakeResponse : public StdNetworkCommand {
public:
	static const unsigned char COMMAND_ID;

public:
	SO_DLLPRFX HandshakeResponse(ByteBuffer* poToBuffer, IDataTypesCoder* poCoder);
	SO_DLLPRFX HandshakeResponse(const INetworkCommand* poParentCommand);

	SO_DLLPRFX virtual void deserialize();
	SO_DLLPRFX virtual void beginSerialize();

	SO_DLLPRFX std::vector<unsigned char>& getHandshakeData();

	SO_DLLPRFX void setError(bool);
	SO_DLLPRFX bool isError();

	SO_DLLPRFX void setErrorMessage(const std::string&);
	SO_DLLPRFX const std::string& getErrorMessage();

	SO_DLLPRFX virtual ~HandshakeResponse();

protected:
	std::vector<unsigned char> m_aHandshakeData;
	bool m_bIsError;
	std::string m_sErrorMessage;

};

}

#endif /* HANDSHAKERESPONSE_HPP_ */
